package com.lguplus.servicepoi.gisp;

import com.lguplus.servicepoi.config.Config;
import com.lguplus.servicepoi.log.SystemLog;

public class GISPChecker extends Thread {

	public GISPChecker(){
		super();
		setName("GISP Checker");
	}
	
	public void run(){
		while(true){
			try {
				GISPClientManager gispClientManager = GISPClientManager.getInstance();
				if(gispClientManager.getStatus())
					SystemLog.Info("GISPCLIENT,LIVE");
				else
					SystemLog.Error("GISPCLIENT,WAIT");
			} catch (Exception e) {
				SystemLog.Error("GISPCLIENT,DIED");
				SystemLog.Error(e);
			}
			
			try {
				sleep(Config.GISP_CHECK_TERM);
			} catch (InterruptedException e) {
				SystemLog.Error(e);
			}
		}
		
	}
}
